UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gUJme8dgFi6KCEi0o3rK57utsL5SBgVhiCZwkEeqQmQ='
WHERE
key_id = '66c66cdff4a0d73555c8eed66a1ca5698e1c4be60da2193929209fda8a620cff'
AND (
token = 'gUJme8dgFi6KCEi0o3rK57utsL5SBgVhiCZwkEeqQmQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)