UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mYyWFmHnHMF2GKULZKHzihdIBjWKlxVDGEOJZj1TQmo='
WHERE
key_id = '41048064593136f49efa9a5c5f8b9e47d508a759c92eba1040b351f9cda5c706'
AND (
token = 'mYyWFmHnHMF2GKULZKHzihdIBjWKlxVDGEOJZj1TQmo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)