UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kcV8LDKsJvDNhLq2kk3To9RXDOsY6P8WDFhHxz1Chpg=' 
WHERE 
  key_id = 'fd5a2f0d965501a7f0c50dff8ace985c9ab5a999a79045f4dbfb3b9360831a77' 
  AND (
    token = 'kcV8LDKsJvDNhLq2kk3To9RXDOsY6P8WDFhHxz1Chpg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014