UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7Z/nWyYICznKMksB6CmJ9/E7iGI0yAW0ZpFtDzhOB2I='
WHERE
key_id = '8544ef78f086f25382acaa13d9d7ffa3d2a869ee8acd0f9926c9960ab8800188'
AND (
token = '7Z/nWyYICznKMksB6CmJ9/E7iGI0yAW0ZpFtDzhOB2I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)