UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vZsxPFQEkvBtjsOWQGt6KXoXLI8LhtjxPRfYYwQeTIk=' 
WHERE 
  key_id = '94deed2b402168fe4fcf6cb29b9fd2a6d10ead334d69aedb18b233a4c2264925' 
  AND (
    token = 'vZsxPFQEkvBtjsOWQGt6KXoXLI8LhtjxPRfYYwQeTIk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033