UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gGhjCOf/Oq1uEI+L8GxsissF/Ihq2kn46EppRNotVfk='
WHERE
key_id = '2f67a34e4290f6cfb4b979b27dafbbfc8067dda7966f91f1a66dda3c1fea232f'
AND (
token = 'gGhjCOf/Oq1uEI+L8GxsissF/Ihq2kn46EppRNotVfk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)