UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ntRI9iJKGy1hJyLL3yC64pd4BJe8MLOSURj7jZMRgJI=' 
WHERE 
  key_id = '45d99d59788c4451d5857b109a8094cf18b38796235c7bc2e187bee66444a5fb' 
  AND (
    token = 'ntRI9iJKGy1hJyLL3yC64pd4BJe8MLOSURj7jZMRgJI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018