UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hpqXnEZ5J56qpawjiFVH/FB6MeISlB4xGNi2QIicMRk=' 
WHERE 
  key_id = 'ca43a5b6174df4051b23f2368c3ff8728f0cd6538cd1da5bec62eb0e1d736c16' 
  AND (
    token = 'hpqXnEZ5J56qpawjiFVH/FB6MeISlB4xGNi2QIicMRk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036