UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qugp8fZuvQEt0wq3Qw2GXpoT05j/psYSyNhUIQ2te88='
WHERE
key_id = 'e60de47427e066da8e17809867bd683d202464b26c043392f7eb491cda0b8c18'
AND (
token = 'qugp8fZuvQEt0wq3Qw2GXpoT05j/psYSyNhUIQ2te88='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)