UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1MmEiy5hVC6mBxViE2beUrCpM5wSLVvzRAlh3z7zwBU='
WHERE
key_id = '15cbae15bc1340a967fc373e0241e8975a1b83d5b9d35b400c243db1b2095a90'
AND (
token = '1MmEiy5hVC6mBxViE2beUrCpM5wSLVvzRAlh3z7zwBU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)