UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LHPbW3UG9J7AALOz3MlH9oK88yBr935iNaJKDDDD3Y4=' 
WHERE 
  key_id = '6934995a0faaa3bee26649b10ff7535409242d79cbf42e2cc0a482d8e9644d4b' 
  AND (
    token = 'LHPbW3UG9J7AALOz3MlH9oK88yBr935iNaJKDDDD3Y4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036