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

Query time 0.00027