UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's35Kj5fVjBYM2Hy/6uh/RWcaTSheMi2q+ppu/evrWyM='
WHERE
key_id = '00f8ce1f2b1e44084b3010d66e2f8eeb1e2e4d904d3eef41bd7675d0ec911459'
AND (
token = 's35Kj5fVjBYM2Hy/6uh/RWcaTSheMi2q+ppu/evrWyM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)