UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iNgWoCjJq+iyx2dZPp1fz7EUoPfVeAM6Bmg2IwHMJd8='
WHERE
key_id = 'abe754edcf2a35cb3eb137c4ccc014da5fd468cb9e9119d28ed0287d0f44dfdb'
AND (
token = 'iNgWoCjJq+iyx2dZPp1fz7EUoPfVeAM6Bmg2IwHMJd8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)