UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+eX6H6xhF2VlNZ0/jIQQRqGRabqD87LKf+ryQ3fScak='
WHERE
key_id = '2e204c4a161ca89423a21e743db988b57faf0b24d03df219d4d741a4c966ea71'
AND (
token = '+eX6H6xhF2VlNZ0/jIQQRqGRabqD87LKf+ryQ3fScak='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)