UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Oq8jzJTaLLgdDxWqEmgxisUN9kw2WTlR/I6+jI3XOEk='
WHERE
key_id = 'eb74c956531f29a16f991c099eb8a14a87e423edd46f49d05d8b27bdc87599e1'
AND (
token = 'Oq8jzJTaLLgdDxWqEmgxisUN9kw2WTlR/I6+jI3XOEk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)