UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7btVLZSwIcvMtolUUOhhcVFOE5hNV6v8bpM4lFom03E='
WHERE
key_id = '8cdb0c47b0e6e7be3965a6f2743f44be600f41bbc3fc570ce74f5ff5113cf984'
AND (
token = '7btVLZSwIcvMtolUUOhhcVFOE5hNV6v8bpM4lFom03E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)