UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7gEi/IE6p0xCbAE47AP6YfwV3FZhUdwocxHB+EOx31o='
WHERE
key_id = '2e5d42f5e93ade424617055ad64ba0afa9ed5a803be007c54bd00c7589f436e6'
AND (
token = '7gEi/IE6p0xCbAE47AP6YfwV3FZhUdwocxHB+EOx31o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)