UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'a/rdPRfiFEdlBHj1xn7+T4G9wJfVMGcW1rITUAoddbY='
WHERE
key_id = '810b7d9404b799aa49508e7aafb2b80acad9a9d61e9b1df71affadb5fc159a27'
AND (
token = 'a/rdPRfiFEdlBHj1xn7+T4G9wJfVMGcW1rITUAoddbY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)