UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't1is9Uq8BeZTlweKvJpNieFp6VyfaLN22MRonZPZPqc='
WHERE
key_id = '209b537540474a5aaffb418ffc37bbc414f108dc03e7b66c918af063c0cbcc03'
AND (
token = 't1is9Uq8BeZTlweKvJpNieFp6VyfaLN22MRonZPZPqc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)