UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1F8YvmLLCL8NnBtO0vST7l5mQOD6pOqKdvV80gmzWtY='
WHERE
key_id = '12e3bc8361d413a42c578da8abe3d778456bd91741b46a39c8794fe3c2b11e3d'
AND (
token = '1F8YvmLLCL8NnBtO0vST7l5mQOD6pOqKdvV80gmzWtY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)