UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zEMl6MGkmPuGXlrBoUXlsqZXoFaxJj3rzINJfBf/i0s=' 
WHERE 
  key_id = '308e8d3179932b090936275892f844957f4aa3472208c4bbb39548d9fcf3a324' 
  AND (
    token = 'zEMl6MGkmPuGXlrBoUXlsqZXoFaxJj3rzINJfBf/i0s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048