UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U5uDjK+peglMnI6E415gKwrzZ4Z237xclQSxZmA11QA=' 
WHERE 
  key_id = '956b6d253990153ac7ffe086801acb5782448b0e04930b8067e8a10dc97bc8c5' 
  AND (
    token = 'U5uDjK+peglMnI6E415gKwrzZ4Z237xclQSxZmA11QA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024