UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RzMfPWJNxgvEgGSt3m1QGRtqNzAy7sZKxWyD3uVKOP0=' 
WHERE 
  key_id = '91fcc29397f5e7ec3a4b0630d2068c55f46071a1fb38cb9ff047ff54609a44ee' 
  AND (
    token = 'RzMfPWJNxgvEgGSt3m1QGRtqNzAy7sZKxWyD3uVKOP0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038