UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'peyxk3kQyPNwuqTOjWDEItyrAAT3r4LSyNhdTO+fjUs='
WHERE
key_id = '1f3c51341fceef08c8223c961f53ba0acac44bd8795c31f0b4412a1feb16c341'
AND (
token = 'peyxk3kQyPNwuqTOjWDEItyrAAT3r4LSyNhdTO+fjUs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)