UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4mrM7WiewDPSPnrXaEFxIULnJtRY5Irtf/SDUYFghPI='
WHERE
key_id = 'b8eca6d15aee6e391c2d1639233744544eb3f04ca75346a151569b7f052e6ad2'
AND (
token = '4mrM7WiewDPSPnrXaEFxIULnJtRY5Irtf/SDUYFghPI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)