UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9qdyZTpsdgtZT0DNnojsPELvDwGwttzkfIFDguxNjWQ='
WHERE
key_id = 'f70395caabf1ebef2b40ffcdd9565b7ef6dd85f11c9b932d7a30263f0308b12e'
AND (
token = '9qdyZTpsdgtZT0DNnojsPELvDwGwttzkfIFDguxNjWQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)