UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3DTm6bFx/x2zWY5L85kU3uGZshyF1eqDrq77kGDWRPM='
WHERE
key_id = 'fa62000a284ffc9b97e04435ccbb3e3a86bde00664b4b6f3ed59c9785847b746'
AND (
token = '3DTm6bFx/x2zWY5L85kU3uGZshyF1eqDrq77kGDWRPM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)