UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lx+Ov32cxdVDqO+6ZaxV/8zfKjuMpqJD5BqxWmMonBg='
WHERE
key_id = 'f5151c181ee132bdd733d96964e4a6eeeb45542fbf4d88971629bcf29db6faae'
AND (
token = 'lx+Ov32cxdVDqO+6ZaxV/8zfKjuMpqJD5BqxWmMonBg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)