UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8tBnTqK1LP6PqhPA7mC/8Psax3VR4WoxYAJdoQnYlNo='
WHERE
key_id = '636d8c386fd81d5175508cb00d596cac7f6b2d4536a2d03e81471a62fb1c8a68'
AND (
token = '8tBnTqK1LP6PqhPA7mC/8Psax3VR4WoxYAJdoQnYlNo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)